package homework.work3.service;

import homework.work3.dao.ProductDao;
import homework.work3.dao.ProductDaoImpl;
import homework.work3.model.Product;
import homework.work3.model.ProductData;

public class ProductServiceImpl implements ProductService {
    private ProductDao dao = new ProductDaoImpl();

    @Override
    public Product[] getAllProducts() {
        return dao.queryAllProducts();
    }

    @Override
    public boolean addProduct(Product product) {
        return dao.addProducts(product);
    }

    @Override
    public Product getProductsID(int i) {

        return dao.getProductsID(1);
    }

    @Override
    public Product getProductsName(String name) {
        return dao.getProductsName(name);
    }

    @Override
    public Product updateProduct(Product p) {
        return dao.updateProduct(p);
    }
}
